package com.cy.server.service.impl;

import com.cy.server.dto.SalaryDto;
import com.cy.server.pojo.Salary;
import com.cy.server.mapper.SalaryMapper;
import com.cy.server.service.ISalaryService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author LiShaoZhuo
 * @since 2021-04-26
 */
@Service
public class SalaryServiceImpl extends ServiceImpl<SalaryMapper, Salary> implements ISalaryService {

    @Autowired
    SalaryMapper salaryMapper;

    @Override
    public PageInfo<Salary> selectSalary(SalaryDto salaryDto) {
        PageHelper.startPage(salaryDto.getCurrentPage(), salaryDto.getPageSize());
        List<Salary> list = salaryMapper.selectSalary(salaryDto);
        PageInfo<Salary> pageInfo = new PageInfo<Salary>(list);
        return pageInfo;
    }
}
